Hierarchical runtime analysis framework for defining vulnerabilities

ABSTRACT

A runtime analysis framework (RTA) stores a hierarchical list of input tags and a hierarchical list of output tags. The RTA stores defined vulnerabilities that include associated input tags and output tags. During runtime the software application may receive a request from a user system. The RTA assigns an input tag from the hierarchical list of input tags to an object associated with the request and assigns an output tag from the hierarchical list of output tags to a method generating a response to the request. The RTA identifies one of the defined vulnerabilities as a potential vulnerability if the assigned output tag and output tag associated the potential vulnerability are in a same subtree of the hierarchical list of output tags and the assigned input tag and the input tag associated with the potential vulnerability are in a same subtree of the hierarchical list of input tags.

COPYRIGHT NOTICE

A portion of the disclosure of this patent document contains materialwhich is subject to copyright protection. The copyright owner has noobjection to the facsimile reproduction by anyone of the patent documentor the patent disclosure, as it appears in the United States Patent andTrademark Office patent file or records, but otherwise reserves allcopyright rights whatsoever.

TECHNICAL FIELD

The technology relates to hierarchical scheme for detecting softwaresecurity vulnerabilities.

BACKGROUND

Software applications may include vulnerabilities or flaws that allowhackers to access data and/or perform actions without authorization. Forexample, the unauthorized hacker may try to access a database or file onbehalf of an authorized user.

Current software analysis programs check for security flaws by trying totest every path through the software application source code. However,the analysis programs only provide snapshot views of the softwareapplication and do not test behaviors or states that may occur duringactual execution runtime. Security analysis programs may not have accessto all application source code and therefore may not be able to testinternal code paths for security flaws.

BRIEF DESCRIPTION OF THE DRAWINGS

The included drawings are for illustrative purposes and serve to provideexamples of possible structures and operations for the disclosedinventive systems, apparatus, methods and computer-readable storagemedia. These drawings in no way limit any changes in form and detailthat may be made by one skilled in the art without departing from thespirit and scope of the disclosed implementations.

FIG. 1A shows a block diagram of an example environment in which anon-demand database service can be used according to someimplementations.

FIG. 1B shows a block diagram of example implementations of elements ofFIG. 1A and example interconnections between these elements according tosome implementations.

FIG. 2 shows an example runtime analysis framework (RTA) used in adatabase system.

FIG. 3 shows an example process performed by the runtime analysisframework.

FIG. 4 shows an alternative example of the runtime analysis framework.

FIG. 5 shows rules used by the runtime analysis framework.

FIG. 6 shows in more detail how the runtime analysis framework maydetect a security vulnerability.

FIG. 7 shows an example hierarchical tagging scheme used by the RTA.

FIG. 8 shows the hierarchical tagging scheme of FIG. 7 in more detail.

FIG. 9 shows another example of the hierarchical tagging scheme.

FIG. 10 shows an example process for using the hierarchical taggingscheme for identifying security vulnerabilities in a softwareapplication.

DETAILED DESCRIPTION

Examples of systems, apparatus, computer-readable storage media, andmethods according to the disclosed implementations are described in thissection. These examples are being provided solely to add context and aidin the understanding of the disclosed implementations. It will thus beapparent to one skilled in the art that the disclosed implementationsmay be practiced without some or all of the specific details provided.In other instances, certain process or method operations, also referredto herein as “blocks,” have not been described in detail in order toavoid unnecessarily obscuring the disclosed implementations. Otherimplementations and applications also are possible, and as such, thefollowing examples should not be taken as definitive or limiting eitherin scope or setting.

In the following detailed description, references are made to theaccompanying drawings, which form a part of the description and in whichare shown, by way of illustration, specific implementations. Althoughthese disclosed implementations are described in sufficient detail toenable one skilled in the art to practice the implementations, it is tobe understood that these examples are not limiting, such that otherimplementations may be used and changes may be made to the disclosedimplementations without departing from their spirit and scope. Forexample, the blocks of the methods shown and described herein are notnecessarily performed in the order indicated in some otherimplementations. Additionally, in some other implementations, thedisclosed methods may include more or fewer blocks than are described.As another example, some blocks described herein as separate blocks maybe combined in some other implementations. Conversely, what may bedescribed herein as a single block may be implemented in multiple blocksin some other implementations. Additionally, the conjunction “or” isintended herein in the inclusive sense where appropriate unlessotherwise indicated; that is, the phrase “A, B or C” is intended toinclude the possibilities of “A,” “B,” “C,” “A and B,” “B and C,” “A andC” and “A, B and C.”

Some implementations described and referenced herein are directed tosystems, apparatus, computer-implemented methods and computer-readablestorage media for identifying articles helpful in resolving userqueries.

In some implementations, the users described herein are users (or“members”) of an interactive online “enterprise social network,” alsoreferred to herein as an “enterprise social networking system,” an“enterprise collaborative network,” or more simply as an “enterprisenetwork.” Such online enterprise networks are increasingly becoming acommon way to facilitate communication among people, any of whom can berecognized as enterprise users. One example of an online enterprisesocial network is Chatter®, provided by salesforce.com, Inc. of SanFrancisco, Calif. salesforce.com. Inc. is a provider of enterprisesocial networking services, customer relationship management (CRM)services and other database management services, any of which can beaccessed and used in conjunction with the techniques disclosed herein insome implementations. These various services can be provided in a cloudcomputing environment as described herein, for example, in the contextof a multi-tenant database system. Some of the described techniques orprocesses can be implemented without having to install software locally,that is, on computing devices of users interacting with servicesavailable through the cloud. While the disclosed implementations may bedescribed with reference to Chatter® and more generally to enterprisesocial networking, those of ordinary skill in the art should understandthat the disclosed techniques are neither limited to Chatter® nor to anyother services and systems provided by salesforce.com, Inc. and can beimplemented in the context of various other database systems such ascloud-based systems that are not part of a multi-tenant database systemor which do not provide enterprise social networking services.

I. Example System Overview

FIG. 1A shows a block diagram of an example of an environment 10 inwhich an on-demand database service can be used in accordance with someimplementations. The environment 10 includes user systems 12, a network14, a database system 16 (also referred to herein as a “cloud-basedsystem”), a processor system 17, an application platform 18, a networkinterface 20, tenant database 22 for storing tenant data 23, systemdatabase 24 for storing system data 25, program code 26 for implementingvarious functions of the system 16, and process space 28 for executingdatabase system processes and tenant-specific processes, such as runningapplications as part of an application hosting service. In some otherimplementations, environment 10 may not have all of these components orsystems, or may have other components or systems instead of, or inaddition to, those listed above.

In some implementations, the environment 10 is an environment in whichan on-demand database service exists. An on-demand database service,such as that which can be implemented using the system 16, is a servicethat is made available to users outside of the enterprise(s) that own,maintain or provide access to the system 16. As described above, suchusers generally do not need to be concerned with building or maintainingthe system 16. Instead, resources provided by the system 16 may beavailable for such users' use when the users need services provided bythe system 16; that is, on the demand of the users. Some on-demanddatabase services can store information from one or more tenants intotables of a common database image to form a multi-tenant database system(MTS). The term “multi-tenant database system” can refer to thosesystems in which various elements of hardware and software of a databasesystem may be shared by one or more customers or tenants. For example, agiven application server may simultaneously process requests for a greatnumber of customers, and a given database table may store rows of datasuch as feed items for a potentially much greater number of customers. Adatabase image can include one or more database objects. A relationaldatabase management system (RDBMS) or the equivalent can execute storageand retrieval of information against the database object(s).

Application platform 18 can be a framework that allows the applicationsof system 16 to execute, such as the hardware or software infrastructureof the system 16. In some implementations, the application platform 18enables the creation, management and execution of one or moreapplications developed by the provider of the on-demand databaseservice, users accessing the on-demand database service via user systems12, or third party application developers accessing the on-demanddatabase service via user systems 12.

In some implementations, the system 16 implements a web-based customerrelationship management (CRM) system. For example, in some suchimplementations, the system 16 includes application servers configuredto implement and execute CRM software applications as well as providerelated data, code, forms, renderable web pages and documents and otherinformation to and from user systems 12 and to store to, and retrievefrom, a database system related data, objects, and Web page content. Insome MTS implementations, data for multiple tenants may be stored in thesame physical database object in tenant database 22. In some suchimplementations, tenant data is arranged in the storage medium(s) oftenant database 22 so that data of one tenant is kept logically separatefrom that of other tenants so that one tenant does not have access toanother tenant's data, unless such data is expressly shared. The system16 also implements applications other than, or in addition to, a CRMapplication. For example, the system 16 can provide tenant access tomultiple hosted (standard and custom) applications, including a CRMapplication. User (or third party developer) applications, which may ormay not include CRM, may be supported by the application platform 18.The application platform 18 manages the creation and storage of theapplications into one or more database objects and the execution of theapplications in one or more virtual machines in the process space of thesystem 16.

According to some implementations, each system 16 is configured toprovide web pages, forms, applications, data and media content to user(client) systems 12 to support the access by user systems 12 as tenantsof system 16. As such, system 16 provides security mechanisms to keepeach tenant's data separate unless the data is shared. If more than oneMTS is used, they may be located in close proximity to one another (forexample, in a server farm located in a single building or campus), orthey may be distributed at locations remote from one another (forexample, one or more servers located in city A and one or more serverslocated in city B). As used herein, each MTS could include one or morelogically or physically connected servers distributed locally or acrossone or more geographic locations. Additionally, the term “server” ismeant to refer to a computing device or system, including processinghardware and process space(s), an associated storage medium such as amemory device or database, and, in some instances, a databaseapplication (for example, OODBMS or RDBMS) as is well known in the art.It should also be understood that “server system” and “server” are oftenused interchangeably herein. Similarly, the database objects describedherein can be implemented as part of a single database, a distributeddatabase, a collection of distributed databases, a database withredundant online or offline backups or other redundancies, etc., and caninclude a distributed database or storage network and associatedprocessing intelligence.

The network 14 can be or include any network or combination of networksof systems or devices that communicate with one another. For example,the network 14 can be or include any one or any combination of a LAN(local area network), WAN (wide area network), telephone network,wireless network, cellular network, point-to-point network, starnetwork, token ring network, hub network, or other appropriateconfiguration. The network 14 can include a TCP/IP (Transfer ControlProtocol and Internet Protocol) network, such as the global internetworkof networks often referred to as the “Internet” (with a capital “I”).The Internet will be used in many of the examples herein. However, itshould be understood that the networks that the disclosedimplementations can use are not so limited, although TCP/IP is afrequently implemented protocol.

The user systems 12 can communicate with system 16 using TCP/IP and, ata higher network level, other common Internet protocols to communicate,such as HTTP, FTP, AFS, WAP, etc. In an example where HTTP is used, eachuser system 12 can include an HTTP client commonly referred to as a “webbrowser” or simply a “browser” for sending and receiving HTTP signals toand from an HTTP server of the system 16. Such an HTTP server can beimplemented as the sole network interface 20 between the system 16 andthe network 14, but other techniques can be used in addition to orinstead of these techniques. In some implementations, the networkinterface 20 between the system 16 and the network 14 includes loadsharing functionality, such as round-robin HTTP request distributors tobalance loads and distribute incoming HTTP requests evenly over a numberof servers. In MTS implementations, each of the servers can have accessto the MTS data; however, other alternative configurations may be usedinstead.

The user systems 12 can be implemented as any computing device(s) orother data processing apparatus or systems usable by users to access thedatabase system 16. For example, any of user systems 12 can be a desktopcomputer, a work station, a laptop computer, a tablet computer, ahandheld computing device, a mobile cellular phone (for example, a“smartphone”), or any other Wi-Fi-enabled device, wireless accessprotocol (WAP)-enabled device, or other computing device capable ofinterfacing directly or indirectly to the Internet or other network. Theterms “user system” and “computing device” are used interchangeablyherein with one another and with the term “computer.” As describedabove, each user system 12 typically executes an HTTP client, forexample, a web browsing (or simply “browsing”) program, such as a webbrowser based on the WebKit platform, Microsoft's Internet Explorerbrowser, Apple's Safari, Google's Chrome, Opera's browser, or Mozilla'sFirefox browser, or the like, allowing a user (for example, a subscriberof on-demand services provided by the system 16) of the user system 12to access, process and view information, pages and applicationsavailable to it from the system 16 over the network 14.

Each user system 12 also typically includes one or more user inputdevices, such as a keyboard, a mouse, a trackball, a touch pad, a touchscreen, a pen or stylus or the like, for interacting with a graphicaluser interface (GUI) provided by the browser on a display (for example,a monitor screen, liquid crystal display (LCD), light-emitting diode(LED) display, among other possibilities) of the user system 12 inconjunction with pages, forms, applications and other informationprovided by the system 16 or other systems or servers. For example, theuser interface device can be used to access data and applications hostedby system 16, and to perform searches on stored data, and otherwiseallow a user to interact with various GUI pages that may be presented toa user. As discussed above, implementations are suitable for use withthe Internet, although other networks can be used instead of or inaddition to the Internet, such as an intranet, an extranet, a virtualprivate network (VPN), a non-TCP/IP based network, any LAN or WAN or thelike.

The users of user systems 12 may differ in their respective capacities,and the capacity of a particular user system 12 can be entirelydetermined by permissions (permission levels) for the current user ofsuch user system. For example, where a salesperson is using a particularuser system 12 to interact with the system 16, that user system can havethe capacities allotted to the salesperson. However, while anadministrator is using that user system 12 to interact with the system16, that user system can have the capacities allotted to thatadministrator. Where a hierarchical role model is used, users at onepermission level can have access to applications, data, and databaseinformation accessible by a lower permission level user, but may nothave access to certain applications, database information, and dataaccessible by a user at a higher permission level. Thus, different usersgenerally will have different capabilities with regard to accessing andmodifying application and database information, depending on the users'respective security or permission levels (also referred to as“authorizations”).

According to some implementations, each user system 12 and some or allof its components are operator-configurable using applications, such asa browser, including computer code executed using a central processingunit (CPU) such as an Intel Pentium® processor or the like. Similarly,the system 16 (and additional instances of an MTS, where more than oneis present) and all of its components can be operator-configurable usingapplication(s) including computer code to run using the processor system17, which may be implemented to include a CPU, which may include anIntel Pentium® processor or the like, or multiple CPUs.

The system 16 includes tangible computer-readable media havingnon-transitory instructions stored thereon/in that are executable by orused to program a server or other computing system (or collection ofsuch servers or computing systems) to perform some of the implementationof processes described herein. For example, computer program code 26 canimplement instructions for operating and configuring the system 16 tointercommunicate and to process web pages, applications and other dataand media content as described herein. In some implementations, thecomputer code 26 can be downloadable and stored on a hard disk, but theentire program code, or portions thereof, also can be stored in anyother volatile or non-volatile memory medium or device as is well known,such as a ROM or RAM, or provided on any media capable of storingprogram code, such as any type of rotating media including floppy disks,optical discs, digital versatile disks (DVD), compact disks (CD),microdrives, and magneto-optical disks, and magnetic or optical cards,nanosystems (including molecular memory ICs), or any other type ofcomputer-readable medium or device suitable for storing instructions ordata. Additionally, the entire program code, or portions thereof, may betransmitted and downloaded from a software source over a transmissionmedium, for example, over the Internet, or from another server, as iswell known, or transmitted over any other existing network connection asis well known (for example, extranet, VPN, LAN, etc.) using anycommunication medium and protocols (for example, TCP/IP, HTTP, HTTPS,Ethernet, etc.) as are well known. It will also be appreciated thatcomputer code for the disclosed implementations can be realized in anyprogramming language that can be executed on a server or other computingsystem such as, for example, C. C++. HTML, any other markup language,Java™, JavaScript, ActiveX, any other scripting language, such asVBScript, and many other programming languages as are well known may beused. (Java™ is a trademark of Sun Microsystems, Inc.).

FIG. 1B shows a block diagram of example implementations of elements ofFIG. 1A and example interconnections between these elements according tosome implementations. That is, FIG. 1B also illustrates environment 10,but FIG. 1B, various elements of the system 16 and variousinterconnections between such elements are shown with more specificityaccording to some more specific implementations. Additionally, in FIG.1B, the user system 12 includes a processor system 12A, a memory system12B, an input system 12C, and an output system 12D. The processor system12A can include any suitable combination of one or more processors. Thememory system 12B can include any suitable combination of one or morememory devices. The input system 12C can include any suitablecombination of input devices, such as one or more touchscreeninterfaces, keyboards, mice, trackballs, scanners, cameras, orinterfaces to networks. The output system 12D can include any suitablecombination of output devices, such as one or more display devices,printers, or interfaces to networks.

In FIG. 1B, the network interface 20 is implemented as a set of HTTPapplication servers 100 ₁-100 _(N). Each application server 100, alsoreferred to herein as an “app server”, is configured to communicate withtenant database 22 and the tenant data 23 therein, as well as systemdatabase 24 and the system data 25 therein, to serve requests receivedfrom the user systems 12. The tenant data 23 can be divided intoindividual tenant storage spaces 112, which can be physically orlogically arranged or divided. Within each tenant storage space 112,user storage 114 and application metadata 116 can similarly be allocatedfor each user. For example, a copy of a user's most recently used (MRU)items can be stored to user storage 114. Similarly, a copy of MRU itemsfor an entire organization that is a tenant can be stored to tenantstorage space 112.

The process space 28 includes system process space 102, individualtenant process spaces 104 and a tenant management process space 110. Theapplication platform 18 includes an application setup mechanism 38 thatsupports application developers' creation and management ofapplications. Such applications and others can be saved as metadata intotenant database 22 by save routines 36 for execution by subscribers asone or more tenant process spaces 104 managed by tenant managementprocess 110, for example. Invocations to such applications can be codedusing PL/SOQL 34, which provides a programming language style interfaceextension to API 32. A detailed description of some PL/SOQL languageimplementations is discussed in commonly assigned U.S. Pat. No.7,730,478, titled METHOD AND SYSTEM FOR ALLOWING ACCESS TO DEVELOPEDAPPLICATIONS VIA A MULTI-TENANT ON-DEMAND DATABASE SERVICE, by CraigWeissman, issued on Jun. 1, 2010, and hereby incorporated by referencein its entirety and for all purposes. Invocations to applications can bedetected by one or more system processes, which manage retrievingapplication metadata 116 for the subscriber making the invocation andexecuting the metadata as an application in a virtual machine.

The system 16 of FIG. 1B also includes a user interface (UI) 30 and anapplication programming interface (API) 32 to system 16 residentprocesses to users or developers at user systems 12. In some otherimplementations, the environment 10 may not have the same elements asthose listed above or may have other elements instead of, or in additionto, those listed above.

Each application server 100 can be communicably coupled with tenantdatabase 22 and system database 24, for example, having access to tenantdata 23 and system data 25, respectively, via a different networkconnection. For example, one application server 100 ₁ can be coupled viathe network 14 (for example, the Internet), another application server100 _(N-1) can be coupled via a direct network link, and anotherapplication server 100 _(N) can be coupled by yet a different networkconnection. Transfer Control Protocol and Internet Protocol (TCP/IP) areexamples of typical protocols that can be used for communicating betweenapplication servers 100 and the system 16. However, it will be apparentto one skilled in the art that other transport protocols can be used tooptimize the system 16 depending on the network interconnections used.

In some implementations, each application server 100 is configured tohandle requests for any user associated with any organization that is atenant of the system 16. Because it can be desirable to be able to addand remove application servers 100 from the server pool at any time andfor various reasons, in some implementations there is no server affinityfor a user or organization to a specific application server 100. In somesuch implementations, an interface system implementing a load balancingfunction (for example, an F5 Big-IP load balancer) is communicablycoupled between the application servers 100 and the user systems 12 todistribute requests to the application servers 100. In oneimplementation, the load balancer uses a least-connections algorithm toroute user requests to the application servers 100. Other examples ofload balancing algorithms, such as round robin andobserved-response-time, also can be used. For example, in someinstances, three consecutive requests from the same user could hit threedifferent application servers 100, and three requests from differentusers could hit the same application server 100. In this manner, by wayof example, system 16 can be a multi-tenant system in which system 16handles storage of, and access to, different objects, data andapplications across disparate users and organizations.

In one example storage use case, one tenant can be a company thatemploys a sales force where each salesperson uses system 16 to manageaspects of their sales. A user can maintain contact data, leads data,customer follow-up data, performance data, goals and progress data,etc., all applicable to that user's personal sales process (for example,in tenant database 22). In an example of a MTS arrangement, because allof the data and the applications to access, view, modify, report,transmit, calculate, etc., can be maintained and accessed by a usersystem 12 having little more than network access, the user can managehis or her sales efforts and cycles from any of many different usersystems. For example, when a salesperson is visiting a customer and thecustomer has Internet access in their lobby, the salesperson can obtaincritical updates regarding that customer while waiting for the customerto arrive in the lobby.

While each user's data can be stored separately from other users' dataregardless of the employers of each user, some data can beorganization-wide data shared or accessible by several users or all ofthe users for a given organization that is a tenant. Thus, there can besome data structures managed by system 16 that are allocated at thetenant level while other data structures can be managed at the userlevel. Because an MTS can support multiple tenants including possiblecompetitors, the MTS can have security protocols that keep data,applications, and application use separate. Also, because many tenantsmay opt for access to an MTS rather than maintain their own system,redundancy, up-time, and backup are additional functions that can beimplemented in the MTS. In addition to user-specific data andtenant-specific data, the system 16 also can maintain system level datausable by multiple tenants or other data. Such system level data caninclude industry reports, news, postings, and the like that are sharableamong tenants.

In some implementations, the user systems 12 (which also can be clientsystems) communicate with the application servers 100 to request andupdate system-level and tenant-level data from the system 16. Suchrequests and updates can involve sending one or more queries to tenantdatabase 22 or system database 24. The system 16 (for example, anapplication server 100 in the system 16) can automatically generate oneor more SQL statements (for example, one or more SQL queries) designedto access the desired information. System database 24 can generate queryplans to access the requested data from the database. The term “queryplan” generally refers to one or more operations used to accessinformation in a database system.

Each database can generally be viewed as a collection of objects, suchas a set of logical tables, containing data fitted into predefined orcustomizable categories. A “table” is one representation of a dataobject, and may be used herein to simplify the conceptual description ofobjects and custom objects according to some implementations. It shouldbe understood that “table” and “object” may be used interchangeablyherein. Each table generally contains one or more data categorieslogically arranged as columns or fields in a viewable schema. Each rowor element of a table can contain an instance of data for each categorydefined by the fields. For example, a CRM database can include a tablethat describes a customer with fields for basic contact information suchas name, address, phone number, fax number, etc. Another table candescribe a purchase order, including fields for information such ascustomer, product, sale price, date, etc. In some MTS implementations,standard entity tables can be provided for use by all tenants. For CRMdatabase applications, such standard entities can include tables forcase, account, contact, lead, and opportunity data objects, eachcontaining pre-defined fields. As used herein, the term “entity” alsomay be used interchangeably with “object” and “table.”

In some MTS implementations, tenants are allowed to create and storecustom objects, or may be allowed to customize standard entities orobjects, for example by creating custom fields for standard objects,including custom index fields. Commonly assigned U.S. Pat. No.7,779,039, titled CUSTOM ENTITIES AND FIELDS IN A MULTI-TENANT DATABASESYSTEM, by Weissman et al., issued on Aug. 17, 2010, and herebyincorporated by reference in its entirety and for all purposes, teachessystems and methods for creating custom objects as well as customizingstandard objects in a multi-tenant database system. In someimplementations, for example, all custom entity data rows are stored ina single multi-tenant physical table, which may contain multiple logicaltables per organization. It is transparent to customers that theirmultiple “tables” are in fact stored in one large table or that theirdata may be stored in the same table as the data of other customers.

II. Runtime Analysis of Software Security Vulnerabilities

A runtime analysis framework (RTA) may embed rules inside a softwareapplication to detect security vulnerabilities. Instead of trying tomanually test every logical flaw through the software application, theRTA framework may identify potentially malicious requests. The RTAframework then determines if security checks are performed prior tooutputting responses to the requests. If no security check is performed,the RTA framework identifies the operation as a security vulnerability.

During runtime of the software application, the runtime analysisframework may assign input tags to objects associated with the userrequests. The input tags may identify the requests as potentiallymalicious and carrying a security risk. The RTA framework then mayassign sanitization tags to the objects identifying security checksperformed on the objects during runtime.

The RTA framework identifies output responses to the user requests thatinclude the objects and compares the input tags assigned to the objectswith any sanitization tags assigned to the objects. The RTA frameworkmay identify the software application as susceptible to a securityvulnerability when the input tags for the objects do not includecorresponding sanitization tags.

The RTA framework uses the tagging scheme to verify security checks areperformed on runtime user flows susceptible to a security vulnerability.By tagging potentially malicious user requests, the RTA framework maynot need to exercise or have access to every source code flow within thesoftware application. The RTA framework may use bytecode to implementrules for the tagging scheme without having to access softwareapplication source code.

FIG. 2 shows an example runtime analysis framework (RTA) 218 operatingin a software application 210. In one example, software application 210may operate within a database system 16, receive user requests 230 fromuser system 12 and provide corresponding responses 232 back to usersystem 12. This is just one example and software application 210 and RTA218 may operate within any hardware or software environment thatperforms any operation. For example, software application 210 mayoperate within any cloud based or private database system 16 or mayoperate within a localized software environment within a laptopcomputer, tablet, smart phone, personal computer (PC), or the like, orany combination thereof.

A user may access database system 16 via user system 12 as describedabove. For example, the user may be a salesman that stores informationabout different customers in a customer relationship management (CRM)database system 16. Input methods 220 within software application 210may create one or more objects 214 from request 230. For example, usersystem 12 may request information regarding a particular customer nameand a Java input method 220 may convert request 230 into one or moreobjects 214. For explanation purposes, only one object 214 is referredto below. However, it should be understood that software application 210may create any number of objects 214 based on request 230.

Object 214 may identify the user making request 230 and identify therequested customer name. Any data, message, string, tag, flag,information, method, function, or the like, or any combination thereofcreated and processed by software application 210 may be referred togenerally as an object.

Software application 210 may preform multiple different operations onobject 214 pursuant to request 230. For example, software application210 may access different files in a file system 242, access data in adatabase 240, and/or access data in memory for information associatedwith request 230.

Software application 210 also may perform different security checksbased on request 230. For example, a security method 221 may perform anaccess check to determine if the user is authorized to view therequested information. Another security method 221 may scrub request 230for malware, such as JavaScript.

Software application 210 may eventually call an output method 212 thatgenerates a response 232 to request 230. For example, output method 212may send a hypertext transfer protocol (HTTP) response to user system 12for displaying on a web page. Response 232 may include data from object214, data from database 240, and/or files from file system 242 requestedin object 214. Other output methods 212 may store data from object 214in database 240 or file system 242.

RTA 218 may identify ingress points where software application 210 anddatabase system 16 are vulnerable to security attacks. For example,request 230 from user system 12 may contain viruses or malware. RTA 218may assign an one or more input tags 216 to object 214 identifyingobject 214 as potentially malicious and a security risk. For explanationpurposes, only one input tag 216 is described below assigned to object214.

RTA 218 also may assign one or more sanitization tags 218 identifyingsecurity checks performed on object 214. For example, RTA 218 may assigna first sanitization tag 218 to object 214 when a security method 221checks database access rights for the user sending request 230. RTA 218may assign other sanitization tags 218 for other security operationsperformed on object 214, such as a security method that scrubs object214 for malware.

RTA 218 also may identify egress points where software application 210generates a response 232 or output for request 230. For example, RTA 218may identify output method 212 as an egress point where response 232 issent back to user system 12. RTA 218 may identify the path from inputmethod 220 to output method 212 as potential security vulnerability,since input method 220 generates object 214 from a user request 230 andoutput method 212 outputs a response 232 associated with the userrequest object 214.

RTA 218 uses input tag 216 and sanitization tag 218 to confirm propersecurity checks are performed on object 214. Any object 214 with aninput tag 216 and no corresponding sanitization tag 218 is identified asa vulnerability in report 222. As mentioned above, RTA 218 may assignmultiple sanitization tags 218 to object 214 for each different securitycheck. RTA 218 may determine if object 214 includes all of the propersanitization tags 218 associated with input tag 216. RTA 218 mayidentify a vulnerability when any of the multiple sanitization tags 218are missing.

In summary, RTA 218 identifies potential vulnerabilities in softwareapplication 210 by assigning an input tag 216 to object 214. RTA 218confirms proper security operations are performed by assigningassociated sanitization tags 218 to object 214. During output method212, RTA 218 then checks object 214 for any input tag 216 and associatedsanitization tags 218. RTA 218 identifies a vulnerability in report 222when object 214 includes input tag 218 but does not include the propersanitization tags 218. RTA 218 may consider an object 214 without aninput tag 216 as not potentially malicious, since the object 214 is notfrom a user request 230.

The tagging scheme in RTA 218 may operate during normal execution ofsoftware application 210 and therefore identify actual runtimevulnerabilities. RTA 218 assigns and checks input tags 216 andsanitization tags 218 based on identified input methods 220, securitymethods 221, and output methods 212. This allows RTA 218 to identifyvulnerabilities without having to access individual lines of source codein software application 210.

FIG. 3 shows an example process for detecting a software vulnerability.In operation 300A, the RTA may detect the software application calling auser input method. For example, the software application may receive arequest that includes a universal resource locator (URL) sent from auser web browser.

In operation 300B, the RTA may assign an input tag to the object fromthe input method. For example, the RTA may assign an input tagidentifying the object generally as a user input or more specifically asa user URL input.

In operation 300C, the RTA may identify one or more security methodscalled by the software application. For example, a security operationmay perform a database access check confirming the user hasauthorization to access the data requested by the object. In operation300D, the RTA may assign a sanitization tag to the object identifyingthe type of security check performed on the object.

In operation 300E, the RTA may detect the software application callingan output method. For example, the software application may call amethod that outputs data associated with the object to a web page,database, or file.

In operation 300F, the RTA compares any input tags assigned to theobject with any sanitization tags assigned to the object. For example,the RTA may first determine if the object includes an input tagindicating the object came from a user and is potentially malicious andmay be a security risk.

If an input tag exists, the RTA may determine if the object includes oneor more corresponding sanitization tags for security operationsperformed on the object. For example, if the output method outputs datafrom a database, the sanitization tag may indicate a database accesscheck was performed confirming the user has rights to access the datafrom the database.

In operation 300F, the RTA may determine there is no vulnerability whenno input tag is assigned to the object indicating the object is notassociated with a user request. The RTA also may determine there is novulnerability when the object includes an input tag and one or moreproper sanitization tags. This indicates the software applicationperformed the proper security checks on an potentially malicious object.

The RTA may identify an object with an assigned input tag and nosanitization tag. This may indicate a vulnerability since the softwareapplication did not perform any security check on the potentiallymalicious user input object. In operation 300G, the RTA may identify thevulnerability by logging the name and line number of the output method.

In operation 300F, the RTA may identify an object with an input tag anda sanitization tag. However, the sanitization tag may not be the propersanitization tag. This may indicate a vulnerability since the softwareapplication did not perform the proper security check on the objectprior to generating a response. In operation 300G, the RTA may identifya vulnerability by logging the name and line number of the outputmethod.

In one example, some or all of the operations described above areperformed during execution runtime while of the software application isreceiving user requests and generating associated responses. In anotherexample, some or all of the operations may be performed offline in atesting environment using test inputs.

FIG. 4 shows another example of runtime analysis framework (RTA) 218located in a software application 400. As mentioned above, softwareapplication 400 may perform any operation within any computer softwareenvironment. For example, software application 400 may be customerrelationship management (CRM) software or any other type of cloudcomputing software.

RTA 218 may identify all normal ingress and egress operations insoftware application 400, such as receiving request 428 from a webbrowser 430 operating on user system 12, accessing a database 422 orfile system 423, and writing/printing responses 426 back to a web page432 on a web browser 430. RTA 218 also may identify security checksperformed during software application 400. RTA 218 may identifyvulnerabilities in software application 400 based on the identifiedinputs, outputs, and security checks.

For example, a user of user system 12 may use web browser 430 to requestinformation regarding a sales lead 434. The user may send request 428for lead 434 to database system 16. An input method 418 in softwareapplication 400 may create a lead object 406 in response to lead request428. Lead object 406 may identify the user on user system 12 andidentify lead 434.

An RTA input rule 420 may include software added to software application400 that assigns input tag 410 to any object 406 created by input method418. For example, a hacker may have entered malware into request 428 andassociated object 406. In another example, a user may simply try to viewa record in database system 16 without proper authorization. Input rule420 may attach input tag 410 identifying lead object 406 as potentiallymalicious and then transfer operation back to input method 418.

One or more input rules 420 may exist within software application 400.Any input method 418 that receives an input or any other potentiallymalicious data may include an associated input rule 420. Each input rule420 may assign an input tag 410 that identifies the type of data withinobject 406. As mentioned above, request 428 may produce multiple objects406 that trigger multiple different input rules 420 to each assign inputtags 410 to one or more of the multiple objects 406. Again, forexplanation purposes only a single object 406 and input tag 410 areshown.

Lead object 406 may travel through different logical paths of softwareapplication 400. For example, software application 400 may call asecurity method 402 to perform a security check on lead object 406 priorto accessing database 422. Software application 400 then may call anoutput method 412 to output data from database 422 back to user system12.

One or more RTA sanitization rules 404 may include software added tosoftware application 400 that attach sanitization tags 408 to leadobject 406. For example as mentioned above, security method 402 mayperform a security check to confirm the user identified in lead object406 is authorized to access database 422. Sanitization rule 404 mayattach sanitization tag 408 to lead object 406 during security method402 and then return control back to security method 402.

One or more RTA output rules 414 may include software added to softwareapplication 400 that assign one or more output tags 415 to associatedoutput methods 412. For example, an output method 412 may output leaddata requested in lead object 406 to web page 432 on user system 12.

In one example, RTA 218 may store a list of defined vulnerabilities 416in memory. Defined vulnerabilities 416 may identify the appropriatesanitization tags for different input and output tags. Output rule 414may compare output tag 415, input tag 410, and sanitization tag 408 withdefined vulnerabilities 416.

Based on the comparison, RTA 218 may determine the code path of leadobject 406 through software application 400 is either vulnerable to asecurity attack or not vulnerable to a security attack. For example, RTA218 may identify a defined vulnerability 416 with an associated outputtag and input tag that match output tag 415 for output method 412 andinput tag 410 for lead object 406, respectively.

RTA 218 may identify a vulnerability when the sanitization tags in theidentified defined vulnerability 416 do not match sanitization tags 408assigned to lead object 406. RTA 218 then may identify the definedvulnerability 416, input method 418 and/or output method 412 as anactual vulnerability in report 424.

RTA 218 may determine the defined vulnerability 416 is not an actualvulnerability when the sanitization tags in defined vulnerability 416match sanitization tags 408 assigned to lead object 406. In other words,RTA 218 confirms software application 400 performed the proper securitycheck on lead object 406 prior to outputting the lead data back to usersystem 12.

RTA 218 may determine any object 406 with no input tag 410 is notpotentially malicious since the object did not come from a user inputrequest. RTA 218 may identify any object 406 with an input tag 410 butno sanitization tags 408 as potentially malicious since no securityoperations were performed on the user input request. RTA 218 then mayidentify the portion of software application 400 including output method412 as vulnerable to a security risk.

Some defined vulnerabilities 416 may include multiple differentsanitization tags 408. For example, a defined vulnerability 416 mayrequire multiple different security checks. RTA 218 may identify avulnerability when object 406 does not include each of the differentsanitization tags in defined vulnerability 416.

Software application 400 may write multiple different pieces of data toweb page 432. For example, the data may include a logo and text. Thelogo may come from a static file in file system 423 or database 422 andmay not be potentially malicious. RTA 218 may not attach an input tag410 to the logo. However, the text may include data from request 428that is potentially malicious.

RTA 218 may assign an input tag 410 to the object associated with thetext and may not assign an input tag 410 to the object associated withthe logo. RTA 218 then may confirm the text object includes anassociated sanitization tag. RTA 218 may not need to confirm the logoobject includes any associated sanitization tag since the logo objectdoes not include an input tag.

Input tags 410, sanitization tags 408, and output tags 415 arealternatively referred to as event tags, flags, events and may includeany other type of identifier. RTA 218 may assign the event tagsidentifying potential vulnerabilities to any method, object, or anyother operation or data within software application 400.

RTA 218 may more easily identify vulnerabilities for existing or newfunctions in software application 400. For example, RTA 218 may define anew potential vulnerability simply by adding a new rule to softwareapplication 400 that assigns a new input tag, sanitization tag, oroutput tag for the new method. RTA 218 then may add a new definedvulnerability 416 that includes the tags associated with the new method.

FIG. 5 shows rules used by RTA 218 in more detail. In one example,software application 400 receives a URL input 428 from the user system12 in FIG. 4. Software application 400 calls input method 418 to processURL input 428, such as getURLparameter( ). Input method 418 may createobject 406 for URL input 428.

Input rule 420 may comprise bytecode that automatically assigns inputtag 410 to object 406 when software application 400 calls input method418. Input tag 410 may be any type of user identifier added to object406. For example, input tag 410 may be series of bits or charactersadded to a data string for object 406. In one example, input tag 410 mayidentify the particular type of user input, such as a URL input.

Sanitization rule 404 may comprise bytecode that automatically assignssanitization tag 408 to object 406 when software application 400 callssecurity method 402. Sanitization tag 408 also may be another series ofbits or characters added to the data string of object 406. In oneexample, sanitization tag 216 may identify a particular type of securityoperation performed by security method 406, such as a security operationthat scrubs object 406 for JavaScript.

As mentioned above, software application 400 may perform multiplesecurity checks based on request 428. For example, software application400 may perform the scrub operation of security method 402. Softwareapplication 400 also may perform a database access check to determine ifthe user has authorization to access a requested database record. RTA218 may add multiple sanitization tags 408 identifying each securitycheck performed on object 406.

Output rule 414 may comprise bytecode that automatically assigns outputtag 415 when software application 400 calls output method 412. In oneexample, output tag 415 may identify a particular type of outputoperation performed by output method 212, such as a HttpOutput( ). Otheroutput rules 414 may attach output tags 415 that identify other types ofoutput methods, such as methods that write to files, databases, and/orweb pages.

FIG. 6 shows an example process for detecting a vulnerability insoftware application 400. As mentioned above, RTA 218 may store definedvulnerabilities 416 in memory that each includes an output tag 452, aninput tag 454, and sanitization tags 456.

In one example, defined vulnerability 416A may identify a cross sitescripting (XSS) vulnerability where a user input may include JavaScriptthat software application 400 could output to a web page. Definedvulnerability 416A may include an output tag 452A for an output methodthat prints an object to a web page, such as a HttpOutput( ) method.

Defined vulnerability 416A also may include an input tag 454A associatedwith the XSS vulnerability. For example, input tag 454A may identify anobject received from a user web page, such as an object generated by aURLInput( ) method. Defined vulnerability 416A also may include one ormore sanitization tags associated with the cross site scriptingvulnerability. For example, a sanitization tag 456A may identify asecurity method that scrubs objects for JavaScript.

Tagging output method 412 with output tag 415 may trigger RTA 218 toperform a vulnerability test. RTA 218 first may determine if output tag415 for output method 412 matches any defined output tags 452 fordefined vulnerabilities 416. RTA 218 may determine output method 412 hasno actual vulnerabilities when output tag 415 does not match any outputtags 452 in defined vulnerabilities 416.

Otherwise, RTA 218 may identify one or more defined vulnerabilities 416with matching output tags 452. In one example, output tag 415 may matchoutput tag 452A for defined vulnerability 416A. RTA 218 then comparesassigned input tag 410 for object 406 with input tag 454A in definedvulnerability 416A.

RTA 218 may disregard defined vulnerability 416A if object 406 does notinclude a matching input tag 454A. For example, assigned output tag 415may match defined output tag 452A, but assigned input tag 410 for object406 may not match defined input tag 454A. In another example, object 406may not have an input tag 410. For example, object 406 may not beassociated with a user input request. RTA 218 also may disregard definedvulnerability 416A since object 406 does not include a matching inputtag.

RTA 218 checks for matching sanitization tags when assigned output tag415 for output method 412 and assigned input tag 410 for object 406match defined output tag 452A and defined input tag 454A, respectively.For example, RTA 218 compares assigned sanitization tag 408 for object406 with sanitization tag 456A for defined vulnerability 416A.

Defined vulnerability 416A is not considered an actual vulnerabilitywhen security flags 408 and 456A match. This indicates softwareapplication 400 performed the proper security check prior to outputtingdata associated with object 406. However, defined vulnerability 416A isconsidered an actual vulnerability when object 406 does not have anassigned sanitization tag 408 or has an assigned sanitization tag 408that does not match sanitization tag 456A. No assigned sanitization tag408 may indicate software application 400 performed no security checkson object 406. A non-matching sanitization tag 408 may indicate softwareapplication 400 performed a security check, but not the proper securitycheck identified by sanitization tag 456A.

RTA 218 identifies an actual vulnerability 462 in report 460 whenassigned sanitization tag 408 does not match defined sanitization tag456A. For example, RTA 218 may identify an actual vulnerability 462 inreport 460 that includes a name 464, class name 466, and line number 468for output method 412.

RTA 218 may identify actual vulnerabilities 462 for any other objects inoutput method 412 or for any another objects in any other output methodsin software application 400. For example, RTA 218 may identify othermethods 412 with an output tag 415 and input tag 410 matchingcorresponding output and input tags in defined vulnerabilities 416, butwithout non-matching sanitization tags 456.

Multiple vulnerabilities may be associated with output method 412 andobject 406. For example, in addition to the XSS security check, softwareapplication 400 might need to perform a database access check to confirmthe user has authorization to view a particular requested databaserecord. A second defined vulnerability 416B may include a same ordifferent output tag 452B and input tag 454B as defined vulnerability416A, and may include a different sanitization tag 456B associated witha database access check.

RTA 218 may identify a second match between the same or other assignedtags 415 and 410 and defined tags 452B and 454B, respectively. RTA 218then may compare the assigned sanitization tags 406 for object 406 withdefined sanitization tag 456B. RTA 218 identifies output method 412 asan actual vulnerability in report 460 when no assigned sanitization tags408 for object 406 match defined sanitization tag 456B. Definedvulnerability 416B is disregarded when one of the assigned sanitizationtags 408 for object 406 matches defined sanitization tag 456B.

A Java compiler may convert source code for software application 400into bytecode. In one example, RTA 218 may be implemented in JavaScriptobject notation (JASON) code. A code generation tool converts the JASONfor RTA 218 into Java bytecode. At runtime the bytecode is convertedinto machine code by a just in time Java compiler.

Using bytecode allows RTA 218 to be integrated with bytecode forsoftware application 400 without having to access associated sourcecode. The bytecode may include a finite set of instructions more easilyidentified and tagged by the RTA rules. RTA 218 also may be implementedin any other languages, such as C++, basic, etc.

III. Hierarchical Runtime Analysis Framework for DefiningVulnerabilities

The RTA framework may use a hierarchical tagging scheme to identifyvulnerabilities in the software application. The runtime RTA frameworkmay store a hierarchical list of input tags and a hierarchical list ofoutput tags. The RTA stores defined vulnerabilities that includeassociated input tags and output tags. During runtime the softwareapplication may receive a request from a user and system. The RTAassigns an input tag from the list of input tags to an object associatedwith the request and assigns an output tag from the list of output tagsto a method generating a response to the request.

The RTA identifies defined vulnerabilities as candidate vulnerabilitiesif the assigned output tag and output tag associated the potentialvulnerability are within a same subtree in the list of output tags. TheRTA identifies the candidate vulnerabilities as potentialvulnerabilities when the assigned input tag and the input tag associatedwith the potential vulnerability are also within a same subtree in thelist of input tags. The hierarchical tagging scheme allow new definedvulnerabilities and tagging rules to more easily be added to the RTAframework.

Referring to FIG. 7, the hierarchical tagging scheme may include ahierarchical input tree 502 defining a hierarchy of requests or inputsreceived by the software application. For example, input tree 502 maydefine an HTTP input as including any one of a URL input, a headerinput, and/or a page input. In this example, the URL input, headerinput, and page input are all defined as child siblings of the HTTPinput.

The hierarchical tagging scheme also may include an output tree 504 thatdefines a hierarchy of responses or outputs generated by the softwareapplication. For example, an HTTP output may include a page output, aheader output, and/or a URL output. The page output may include any oneof a HTML output and/or a JavaScript output. The page output, headeroutput, and URL output are all defined as child siblings of the HTTPoutput. The HTML output and JavaScript outputs are defined as childsiblings of the page output.

These are just examples of inputs received by the software applicationor responses output by the software application. Any input or output maybe defined within input tree 502 and output tree 504, respectively. Forexample, input tree 502 and output tree 504 may further define ahierarchical list of inputs and outputs, for pages, files, anddatabases, etc.

The RTA framework uses input tree 502 and output tree 504 to abstractinputs, outputs, and vulnerability rules to different selectable levels.Input rules may assign input tags 510 to objects 542 returned by aninput method 508 according to the hierarchical input tag structure ininput tree 502. For example, input rule 506 may assign a URL input tag510 defined in input tree 502 to request.getParameters( ) method 508.URL input tag 510 is a child of the HTTP input tag and a sibling to theheader input tag and the page input tag.

Output rules 512 may assign output tags 516 to output methods called bythe software application according to the hierarchical output tagstructure in output tree 504. For example, output rule 512 may assign apage output tag 516 defined in output tree 504 to response.write( )method 512. Page output tag 516 is a child of the HTTP output tag and asibling of the header and URL output tags. Page output tag 516 alsoincludes child HTML and JavaScript output tags.

The hierarchical tagging allows RTA 218 to add new input and outputrules without having to alter/amend specific defined vulnerabilities520. Rules 506 and 512 only need to assign tags corresponding toassociated input or output methods. Defined vulnerabilities 520 thenclassify any new or different input or output tag within a subtree ofinput tree 502 and output tree 504, respectively.

For example, defined vulnerability 520 may identify a generic output520A corresponding to one of the outputs in output tree 504 and identifya generic input 520B corresponding to one of the inputs in input tree502. Defined vulnerability 520 also may include a sanitization tag 520Csimilar to sanitization tags described above that identifies asanitization operation the software application is expected to performon the tagged object.

Output tag 516 is assigned to output method 514 during runtime andtriggers the RTA framework to perform a hierarchical vulnerabilityverification. RTA 218 first determines the hierarchical relationshipsbetween output tag 516 assigned to output method 516 and any definedvulnerabilities 520. For example, RTA 218 identifies a subtree 522 bywalking down output tree 504 from the root HTTP output tag to pageoutput tag 516. Defined vulnerability 520 identifies a candidatevulnerability since page output 520A is located in subtree 522.

Identified as a candidate vulnerability, RTA 218 next determines thehierarchical relationship between input tag 510 assigned to object 542and input 520B in defined vulnerability 520. RTA 218 identifies subtree524 by walking up input tree 502 from more specific URL input tag 510 tothe HTTP input 520B. Defined vulnerability 520 is identified as apotential vulnerability since page output 520A is located within subtree522 and HTTP input 520B is located within subtree 524. In other words,page output tag 516 is a type of page output 520A and URL input tag 510is a type of HTTP input 520B.

RTE 218 compares the sanitization tags assigned to object 542 withsanitization 520C in potential vulnerability 520. For example, asdescribed above, RTE 218 determines if object 542 includes asanitization tag matching text escaping sanitization 520C in potentialvulnerability 520. If so, the software application performed the correctsanitization operation for the identified input and output operations.If not, RTA 218 identifies output method 508 as a vulnerability in thesoftware application.

As described above, defined vulnerability 520 may identify any type ofsanitization operation, such as a text escaping sanitization where thesoftware application prints data on the page; an access check where thesoftware application confirms access rights to view data in a page, fileor database; or a ScrubURL check where the software application checksfor JavaScript before redirecting an object to another location.

Defined vulnerability 520 identifies particular sanitization operationsthat the software application should perform based on where an object isreceived and where the object is eventually output. For example, anobject may come from the body of webpage and may be output to a file.The software application may need to perform one or more particularsanitizations for the object based on the type of body input and thetype of file output.

The tree structure in input tree 502 and output tree 504 allow a samedefined vulnerably 520 to generically encompass multiple different typesof inputs and outputs at different file, database, and HTTP levels, etc.For example, defined vulnerability 520 with page output 520A mayencompass a subtree of output tags that may include page output tags,HTML output tags, and JavaScript output tags. Similarly, definedvulnerability 520 with HTTP input 520B may encompass a subtree of inputtags that include HTTP input tags, URL input tags, header input tags,and page input tags. This prevents having to define new vulnerabilities520 and create new event tags 510 and 516 for each new input method 508and each new output method 514.

FIG. 8 describes the hierarchical tagging scheme of FIG. 7 in moredetail. A user system may send a request that causes the softwareapplication in the database system to call request.getParameter( ) inputmethod 508. Input method 508 may return an object or string 542. Inputrule 506 in FIG. 7 may attach input tag 510 identifying object 542 as aURL input.

During runtime of the software application, one or more sanitizationrules may assign one or more sanitization tags 540 to object 542. Forexample, a sanitization rule may assign text escaping sanitization tag540 to object 542 after the software application calls a sanitizationmethod that checks text in object 542. The software application then maycall an output method, such as response.write( ) method 514 that writesobject 542 to a page. Output rule 512 in FIG. 7 may assign page outputtag 516 to response.write( ) output method 514.

RTA 218 may define multiple different vulnerabilities, including but notlimited to, defined vulnerabilities 520 and 544. As described above,defined vulnerability 520 may identify a hierarchical page output 520A,a hierarchical HTTP input 520B, and a text escaping sanitization 520C.Defined vulnerability 544 may identify a hierarchical URL output 544A, ahierarchical HTTP input 544B, and an access check sanitization 544C.

RTA 218 performs a hierarchical analysis of defined vulnerabilities 520or 544 in response to output rule 512 in FIG. 7 assigning output tag 516to output method 514. RTA 218 identifies [HTTP OUTPUT->PAGE OUTPUT]subtree 522 by walking down output tree 504 from the HTTP root output topage output tag 516. In this example, defined vulnerability page output520A is part of subtree 522. In other words, page output tag 516 is atype of page output 520A in defined vulnerability 560.

Based on the inclusion of page output 520A in subtree 522. RTA 218compares the hierarchical relationship between input tag 510 and input520B in defined vulnerability 520. RTA 218 identifies [URL INPUT->HTTPINPUT] subtree 524 by walking up input tree 502 from the more specificinput tag 510 assigned to object 542 (e.g. URL input) to a higher levelHTTP input 520B in defined vulnerability 520. Subtree 524 indicates URLinput tag 510 is of type HTTP input 520B.

Based on the inclusion of page output 520A in subtree 522 and theinclusion of HTTP input 520B in subtree 524, RTA 218 checks sanitationtag 540 assigned to object 542 with sanitization 520C in definedvulnerability 520. In this example, sanitization tag 540 indicates thesoftware application performed the text escaping sanitization operationon object 542 identified by sanitization 520C in defined vulnerability520. Therefore, RTA 218 does not identify output method 514 as avulnerability. RTA 218 may have identified output method 514 as avulnerability if input object 542 did not include text escapingsanitization tag 540.

RTA 218 also compares output method 514 with defined vulnerability 544.In this example, URL output 544A in defined vulnerability 544 is notpart of [HTTP OUTPUT->PAGE OUTPUT] subtree 522. In other words, pageoutput tag 516 is not a type of URL output 544A in defined vulnerability544. Therefore, RTA 218 disregards defined vulnerability 544 as apotential vulnerability.

FIG. 9 shows another example of the hierarchical tagging scheme. Duringsoftware application runtime an input rule may assign a hierarchicalpage input tag 552 to an input object 554 called by input method 550.Also during runtime of the software application, an RTA output rule mayassign a hierarchical JavaScript output tag 558 to an output method 556that outputs object 554. For example, input method 550 may receive apage input and output method 556 may output JavaScript.

A defined vulnerability 560 identifies a page output 560A, a HTTP input560B, and a text escaping sanitation 560C. A defined vulnerability 562may identify a HTTP output 562A, a URL input 562B, and an access check562C.

JavaScript output tag 558 forms [HTTP OUTPUT->PAGE OUTPUT->JAVASCRIPTOUTPUT] subtree 564 in output tree 504 and page output 560A in definedvulnerability 560 is part of subtree 564. Page input tag 552 is part ofa [PAGE INPUT->HTTP INPUT] subtree 564 in input tree 30. In other words,page input tag 552 is a type of HTTP input 560B in defined vulnerability560.

Based on the inclusion of page output 560A in subtree 564 and input tag552 in subtree 570, RTA 218 compares sanitization tag 553 withsanitization 560C in defined vulnerability 560. Since access check tag553 is not a text escaping sanitation check 560, RTA 218 identifiesoutput method 556 as a vulnerability.

RTA 218 also checks output tag 558 with defined vulnerability 562. HTTPoutput 562A in defined vulnerability 562 is also part of [HTTPOUTPUT->PAGE OUTPUT->JAVASCRIPT OUTPUT] subtree 564 in output tree 504.However, page input tag 552 is a sibling and not a type of URL input562B. Therefore, RTA 218 does not consider defined vulnerability 560 apotential vulnerability and does not compare sanitization tag 553 withsanitization 562C.

FIG. 10 shows an example process for the hierarchical tagging scheme. Inoperation 600A, the RTA identifies an output method assigned an outputtag. For example, an output rule may assign an output tag to an outputmethod that outputs an object.

In operation 600B, the RTA may identify a subtree for the output tag.For example, the RTA may walk down from the root of the output tree tothe output tag. In operation 600C, the RTA determines if the definedvulnerability output is part of the output subtree. If not, the RTAdisregards the defined vulnerability and checks the subtree for a nextdefined vulnerability.

If the defined vulnerability output is part of the output subtree, theRTA in operation 600D identifies the input subtree for the object inputtag. For example, the RTA may walk up the input tree from the input tagto the defined vulnerability input. In operation 600E, the RTAdetermines if the input tag is a type of defined vulnerability input.For example, the RTA determines if the input tag is a same type or childof the vulnerability input. If not, the RTA disregards the definedvulnerability and checks the next defined vulnerability.

If the input tag is a type of defined vulnerability input, the RTA inoperation 600F compares the object sanitization tags with the definedvulnerability sanitization tag. If none of the object sanitization tagsmatch the defined vulnerability sanitization tag, the RTA identifies theoutput method as a vulnerability in operation 600G. If the objectsanitization tag matches the same defined vulnerability sanitizationtag, the RTA dismisses the defined vulnerability and checks the nextdefined vulnerability. For example, if some other sanitization tag ispresent for the object but is not the sanitization tag in the definedvulnerability, the software flow in the software application would bemarked as a vulnerability.

The input, output, and vulnerability rules are highly extensible anddetection of already defined vulnerabilities can easily be added as newJava methods. New vulnerability types can also easily be added toexisting events with Java method mappings. JavaScript object notation(JSON) files may include event types, hierarchy, and mappings and may beparsed and compiled into a map and stored as serialized byte-code. Theparsing/serialization may happen at compile time.

During execution of the runtime analysis, the serialized byte-coderepresentation may be loaded in memory and used to detectvulnerabilities. Each JSON is parsed into a tree based representation asdescribed above with each event in the map having an associatedparent/child relationship. Once the input and output trees arepopulated, each tree element is stored in a hash map while preservingthe parent/child relationship, so that any identified event we can belocated with respect to other elements. The serialized form of the inputtree and output tree hash maps provide more efficient memory andcomputation utilization.

The specific details of the specific aspects of implementationsdisclosed herein may be combined in any suitable manner withoutdeparting from the spirit and scope of the disclosed implementations.However, other implementations may be directed to specificimplementations relating to each individual aspect, or specificcombinations of these individual aspects. Additionally, while thedisclosed examples are often described herein with reference to animplementation in which an on-demand database service environment isimplemented in a system having an application server providing a frontend for an on-demand database service capable of supporting multipletenants, the present implementations are not limited to multi-tenantdatabases or deployment on application servers. Implementations may bepracticed using other database architectures. i.e., ORACLE®, DB2® by IBMand the like without departing from the scope of the implementationsclaimed.

It should also be understood that some of the disclosed implementationscan be embodied in the form of various types of hardware, software,firmware, or combinations thereof, including in the form of controllogic, and using such hardware or software in a modular or integratedmanner. Other ways or methods are possible using hardware and acombination of hardware and software. Additionally, any of the softwarecomponents or functions described in this application can be implementedas software code to be executed by one or more processors using anysuitable computer language such as, for example, Java. C++ or Perlusing, for example, existing or object-oriented techniques. The softwarecode can be stored as a computer- or processor-executable instructionsor commands on a physical non-transitory computer-readable medium.Examples of suitable media include random access memory (RAM), read onlymemory (ROM), magnetic media such as a hard-drive or a floppy disk, oran optical medium such as a compact disk (CD) or DVD (digital versatiledisk), flash memory, and the like, or any combination of such storage ortransmission devices. Computer-readable media encoded with thesoftware/program code may be packaged with a compatible device orprovided separately from other devices (for example, via Internetdownload). Any such computer-readable medium may reside on or within asingle computing device or an entire computer system, and may be amongother computer-readable media within a system or network. A computersystem, or other computing device, may include a monitor, printer, orother suitable display for providing any of the results mentioned hereinto a user.

While some implementations have been described herein, it should beunderstood that they have been presented by way of example only, and notlimitation. Thus, the breadth and scope of the present applicationshould not be limited by any of the implementations described herein,but should be defined only in accordance with the following andlater-submitted claims and their equivalents.

What is claimed is:
 1. A computer program for detecting potentialvulnerabilities in a software application in a database system, thecomputer program comprising a set of instructions operable to: store ahierarchical list of input tags for the software application, wherein atleast some of the input tags have hierarchical relationships; store ahierarchical list of output tags for the software application, whereinat least some of the output tags have hierarchical relationships; storedefined vulnerabilities wherein the defined vulnerabilities include atleast one associated input tag and at least one associated output tag;during runtime of the software application, receive a request by thesoftware application in the database system from a user system; duringruntime of the software application, assign an input tag from thehierarchical list of input tags to an object associated with therequest; during runtime of the software application, assign an outputtag from the hierarchical list of output tags to a method generating aresponse to the request; and during runtime of the software application,identify one of the defined vulnerabilities as a potential vulnerabilityif the assigned output tag is identified in the hierarchical list ofoutput tags as a type of output tag associated with the potentialvulnerability and the assigned input tag is identified in thehierarchical list of input tags as a type of input tag associated withthe potential vulnerability.
 2. The computer program of claim 1, furthercomprising instructions operable to: identify an output subtree in thehierarchical list of output tags from a root output tag down to theassigned output tag; and identify the assigned output tag as a type ofthe output tag associated with the potential vulnerability when theoutput tag associated with the potential vulnerability is located in theoutput subtree.
 3. The computer program of claim 2, further comprisinginstructions operable to: identify an input subtree in the hierarchicallist of input tags from the assigned input tag up to a root input tag;and identify the assigned input tag as a type of input tag associatedwith the potential vulnerability when the input tag associated with thepotential vulnerability is located in the input subtree.
 4. The computerprogram of claim 1, wherein the hierarchical list of input tags includesa parent hypertext transfer protocol (HTTP) input tag and sibling childuniversal resource locator (URL), header, and page input tags.
 5. Thecomputer program of claim 1, wherein the hierarchical list of outputtags includes a parent hypertext transfer protocol (HTTP) output tag andsibling child page, header, and universal resource locator (URL) outputtags.
 6. The computer program of claim 5, wherein the sibling child pageoutput tags include sibling child hypertext markup language (HTML) andJavaScript output tags.
 7. The computer program of claim 1, furthercomprising instructions operable to identify the potential vulnerabilityas an actual vulnerability in the software application when asanitization tag associated with the potential vulnerability are not asame sanitization tag assigned to the object.
 8. The computer program ofclaim 1, further comprising instructions operable to assign the inputtag to the object based on a type of input method receiving the requestand assign the output tag based on a type of method generating theresponse to the request.
 9. The computer program of claim 1, furthercomprising instructions operable to generate rules in bytecode of thesoftware application to assign the input tag, assign the output tag, andidentify the potential vulnerability.
 10. A system for detectingvulnerabilities in a software application operating in a databasesystem, comprising: a processor; and memory storing one or more storedsequences of instructions which, when executed by the processor, causethe processor to carry out the steps of: storing a hierarchical list ofinput tags; storing a hierarchical list of output tags; storing definedvulnerabilities each including an associated input tag and an associatedoutput tag; receiving a request by the software application in thedatabase system from a user system; assigning an input tag from thehierarchical list of input tags to an object returned by the softwareapplication based on the request; assigning an output tag from thehierarchical list of output tags to a method in the software applicationgenerating a response to the request; and identifying one of the definedvulnerabilities as a potential vulnerability if the assigned output tagand the output tag associated with the potential vulnerability arewithin a same subtree of the hierarchical list of output tags and theassigned input tag and the input tag associated with the potentialvulnerability are within a same subtree of the hierarchical list ofinput tags.
 11. The system of claim 10, wherein the instructions furthercause the processor to carry out the steps of assigning the input tag,assigning the output tag, and identifying the potential vulnerabilityduring runtime of the software application.
 12. The system of claim 10,wherein the instructions further cause the processor to carry out thesteps of identifying the potential vulnerability as an actualvulnerability in the software application when a sanitization tagassociated with the potential vulnerability are not a sanitization tagassigned to the object.
 13. The system of claim 10, wherein theinstructions further cause the processor to carry out the steps ofidentifying the assigned output tag and the output tag associated withthe potential vulnerability as part of the same subtree when theassigned output tag is identified as a same type or child of the outputtag associated with the potential vulnerability.
 14. The system of claim10, wherein the instructions further cause the processor to carry outthe steps of identifying the assigned input tag and the input tagassociated with the potential vulnerability as part of the same subtreewhen the assigned input tag is identified as a same type or child of theinput tag associated with the potential vulnerability.
 15. The system ofclaim 10, wherein the hierarchical list of input tags includes a parenthypertext transfer protocol (HTTP) input tag and sibling child universalresource locator (URL), header, and page input tags.
 16. The system ofclaim 10, wherein: the hierarchical list of output tags includes aparent hypertext transfer protocol (HTTP) output tag and sibling childpage, header, and universal resource locator (URL) output tags; and thesibling child page output tag includes sibling child hypertext markuplanguage (HTML) and JavaScript output tags.
 17. The system of claim 10,wherein at least some of the stored sequences of instructions includeJava bytecode for assigning the input tag, assigning the output tag, andidentifying the potential vulnerability.
 18. A method for detecting avulnerability in a software application in a database system,comprising: storing a defined vulnerability that includes an outputevent, an input event, and a sanitization event; receiving by thesoftware application in the database system a request from a usersystem; executing an input rule in the software application thatidentifies an input event for an object associated with the request;executing a sanitization rule in the software application thatidentifies a sanitization event for a security operation performed onthe object; executing an output rule in the software application thatidentifies an output event for a method generating a response to therequest; and executing a vulnerability rule in the software applicationthat identifies a vulnerability in a part of the software applicationbased on a hierarchical relationship between the identified output eventand the defined vulnerability output event, a hierarchical relationshipbetween the identified input event and the defined vulnerability inputevent, and a relationship between the identified sanitization event andthe defined vulnerability sanitization event.
 19. The method of claim17, further comprising: storing a hierarchical input tree thatidentifies hierarchical relationships for different input events;storing a hierarchical output tree that identifies hierarchicalrelationships for different output events; identifying a potentialvulnerability in software application when the identified output eventand the defined vulnerability output event are within a same subtree ofthe hierarchical output tree, and the identified input event and thedefined vulnerability input event are within a same subtree of thehierarchical input tree.
 20. The method of claim 17, further comprisingidentifying the vulnerability in the software application when asanitization event identified for the object is not the definedvulnerability sanitization event.